//
//  theme.swift
//  Swift夜间模式
//
//  Created by Hahn on 2018/11/2.
//  Copyright © 2018 今晚打老虎. All rights reserved.
//

import UIKit

class theme: NSObject {
    
    /**
     swfit没有pragma
     需要用的颜色
     */
    var color:UIColor!
    var color1:UIColor!
    var color2:UIColor!
    var color3:UIColor!
    var color4:UIColor!
    var color5:UIColor!
    
    //在Swift语言中用了willSet和didSet这两个特性来监视属性的除初始化之外的属性值变化
    var appColor:NSInteger?{
        willSet{
            if appColor == 0 {
                self.color = UIColor.white
                self.color2 = UIColor.black
                self.color3 = UIColor.white
                self.color4 = UIColor.red

            }else if appColor == 1 {
                self.color = UIColor.init(red: 0.06, green: 0.08, blue: 0.1, alpha: 1)
                self.color2 = UIColor.white
                self.color3 = UIColor.red
                self.color4 = UIColor.white

            }
        }
        didSet{
            if appColor == 0 {
                self.color = UIColor.white
                self.color2 = UIColor.black
                self.color3 = UIColor.white
                self.color4 = UIColor.red
            }else if appColor == 1 {
                self.color = UIColor.init(red: 0.06, green: 0.08, blue: 0.1, alpha: 1)
                self.color2 = UIColor.white
                self.color3 = UIColor.red
                self.color4 = UIColor.white
            }
        }

    }
    
    // MARK: 设置单例
    static let Theme = theme();
    
}
